from django.db import models


# Create your models here.
class LeaveType(models.Model):
    tname = models.CharField(max_length=20)


class Leave(models.Model):
    STATUS = ((0, '待审核'), (1, '通过'), (2, '未通过'))
    stu_name = models.CharField(max_length=20, null=False)
    status = models.IntegerField(choices=STATUS, default=0)
    createTime = models.DateTimeField()
    context = models.CharField(max_length=200)
    tid = models.ForeignKey(LeaveType, on_delete=models.CASCADE)


class User(models.Model):
    # role int(1) not null--用户的角色：用1代表学生 2代表老师
    ROLE = ((1, '学生'), (2, '老师'))
    uname = models.CharField(max_length=20, null=False)
    upwd = models.CharField(max_length=20, null=False)
    role = models.IntegerField(max_length=1, choices=ROLE)
